package com.action.common;

import java.io.IOException;

import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

public class Ajax {
	
	public static void sendMsgAjax(String s) throws IOException{ 
		HttpServletResponse  response = ServletActionContext.getResponse();
		response.setContentType("text/html;charset=utf-8");
		response.getWriter().print(s);
	}
	
	public static void sendMsg(String s) { 
		HttpServletResponse  response = ServletActionContext.getResponse();
		response.setContentType("text/html;charset=utf-8");
		try {
			response.getWriter().print(s);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
